Skip to content

Conversation

@dogi
Copy link
Member

@dogi dogi commented Nov 10, 2025

  • Injected UserRepository into AdapterTask to handle user data fetching.
  • Removed direct Realm instance calls from showAssignee to prevent per-item database queries.
  • Updated TeamTaskFragment to provide the UserRepository to the adapter.

This change improves RecyclerView performance by centralizing data access and reducing synchronous I/O on the main thread.


https://jules.google.com/session/18431213191892173805

- Injected `UserRepository` into `AdapterTask` to handle user data fetching.
- Removed direct `Realm` instance calls from `showAssignee` to prevent per-item database queries.
- Updated `TeamTaskFragment` to provide the `UserRepository` to the adapter.

This change improves RecyclerView performance by centralizing data access and reducing synchronous I/O on the main thread.
- Injected `UserRepository` into `AdapterTask` to handle user data fetching.
- Removed direct `Realm` instance calls from `showAssignee` to prevent per-item database queries.
- Updated `TeamTaskFragment` to use the inherited `userRepository` and pass it to the adapter.
- Fixed a compilation error caused by a duplicate `UserRepository` injection.

This change improves RecyclerView performance by centralizing data access and reducing synchronous I/O on the main thread.
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 328 to 333

private fun updatedTeamTaskList(updatedList: RealmResults<RealmTeamTask>) {
viewLifecycleOwner.lifecycleScope.launch {
adapterTask = AdapterTask(requireContext(), updatedList, !isMemberFlow.value, viewLifecycleOwner.lifecycleScope)
adapterTask = AdapterTask(requireContext(), updatedList, !isMemberFlow.value, viewLifecycleOwner.lifecycleScope, userRepository)
adapterTask.setListener(this@TeamTaskFragment)
binding.rvTask.adapter = adapterTask

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P0 Badge Inject UserRepository into TeamTaskFragment

The new adapter constructor requires a UserRepository, and TeamTaskFragment now passes userRepository when creating AdapterTask. However, this fragment does not declare or inject a UserRepository field anywhere, so the references at the adapter instantiations fail to compile with Unresolved reference: userRepository. Add an @Inject lateinit var userRepository: UserRepository (or equivalent constructor injection) before using it; otherwise the module cannot build.

Useful? React with 👍 / 👎.

@dogi dogi added the close? label Nov 10, 2025
@dogi dogi closed this Nov 10, 2025
@dogi dogi reopened this Nov 10, 2025
@dogi dogi removed the close? label Nov 10, 2025
@dogi dogi changed the title Refactor: Optimize AdapterTask to use UserRepository teams: smoother user repository task realm handling (fixes #9032) Nov 11, 2025
@dogi dogi merged commit b6c762f into master Nov 11, 2025
3 checks passed
@Okuro3499 Okuro3499 deleted the feat-optimize-adapter-task branch November 11, 2025 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants